<#include "header.htm"/>

<#import "../macros/pagination.ftl" as pagination>
<#import "../macros/presentation.ftl" as presentation/>

<script type="text/javascript" src="${contextPath}/templates/${templateName}/js/pagination.js?${startupTime}"></script>



	<div class="pagination">
						<#assign paginationLinks>
							<@pagination.doPagination action/>
						</#assign>

						${paginationLinks}
   	</div>
				

				   <h2>
				   			${I18n.getMessage("Search.searchFound")}
							${totalRecords} 
							
							<#if (totalRecords == 1)>
								${I18n.getMessage("Search.match")}
							<#else>
								${I18n.getMessage("Search.matches")}
							</#if>
				   </h2>


		<div class="forumbg">
		<div class="inner"><span class="corners-top"><span></span></span>
		<ul class="topiclist">
			<li class="header">
				<dl class="icon">
					<dt>${I18n.getMessage("ForumIndex.topics")}</dt>
					<dd class="posts">${I18n.getMessage("ForumIndex.replies")}</dd>
					<dd class="views">${I18n.getMessage("ForumIndex.views")}</dd>
					<dd class="lastpost"><span>${I18n.getMessage("ForumIndex.lastPost")}</span></dd>
				</dl>
			</li>
		</ul>
		<ul class="topiclist topics">

				<#list results as topic>
					<#if topic_index % 2 == 0>
						<#assign rowColor = "bg2">
					<#else>
						<#assign rowColor = "bg1">
					</#if>



			 
				 <li class="row ${rowColor}">    
				    <dl class="icon <@presentation.folderImage topic/>">
				<dt>
					<a class="topictitle" href="${JForumContext.encodeURL("/posts/list/${topic.id}")}">
					<#if topic.vote>${I18n.getMessage("ForumListing.pollLabel")}</#if>
					<#if (topic.title?length == 0)>
						No Subject
					<#else>
						${topic.title?html}
					</#if>
					</a>
					<#if topic.hasAttach()>
					   <img src="${contextPath}/templates/${templateName}/img/icon_topic_attach.gif" />
					</#if>
					<br />
					<#assign forum = fr.getForum(topic.forumId)/>
					${I18n.getMessage("by")}&nbsp;<a style="color: #AA0000;" class="username-coloured" href="${JForumContext.encodeURL("/user/profile/${topic.postedBy.id}")}">${topic.postedBy.username}</a>
					&raquo;${topic.firstPostTime} in <a href="${JForumContext.encodeURL("/forums/show/${forum.id}")}">${forum.name?html}</a>
    						<#if topic.paginate>
								<@pagination.littlePostPagination topic.id, postsPerPage, topic.totalReplies/>
							</#if>
				</dt>
				
				<dd class="posts">${topic.totalReplies} <dfn>${I18n.getMessage("ForumIndex.replies")}</dfn></dd>
				<dd class="views">${topic.totalViews} <dfn>${I18n.getMessage("ForumIndex.views")}</dfn></dd>
				
				<#if (topic.lastPostTime?length > 0)>
					<dd class="lastpost"><span><dfn>${I18n.getMessage("ForumIndex.lastPost")} </dfn>${I18n.getMessage("by")}&nbsp;
					<a style="color: #AA0000;" class="username-coloured" href="${JForumContext.encodeURL("/user/profile/${topic.lastPostBy.id}")}">${topic.lastPostBy.username}</a>
					<#assign startPage = ""/>
					<#if (topic.totalReplies + 1 > postsPerPage?number)>
						<#assign startPage = ((topic.totalReplies / postsPerPage?number)?int * postsPerPage?number) +"/"/>
					</#if>
					<a href="${JForumContext.encodeURL("/posts/list/${startPage}${topic.id}")}#${topic.lastPostId}"><img src="${contextPath}/templates/${templateName}/img/icon_topic_latest.gif" border="0" alt="[Latest Reply]" /></a>
					<br />
					${topic.lastPostTime}
					</span>
					</dd>
					
				</#if>
			</dl>
		</li>
	</#list>

			</ul>
		<span class="corners-bottom"><span></span></span></div>
	</div>



	<div class="pagination">
		${paginationLinks}
   	</div>
   	
   	<@presentation.forumsComboTable/>


<#include "bottom.htm"/>
